# -*-coding:UTF-8 -*-
'''
Created on 2013-6-18

@author: hanjiewu
'''

'''
集成关系
object
    timedelta
    tzinfo
    time
    date
        datetime
'''
import datetime
from datetime import timedelta

print datetime.MINYEAR
print datetime.MAXYEAR

d = timedelta(microseconds=10)
print (d.days, d.seconds, d.microseconds)

print timedelta(hours= -5)

year = timedelta(days=365)
another_year = timedelta(weeks=40, days=84, hours=23, minutes=50, seconds=600)

print year.total_seconds()
print year == another_year

ten_years = 10 * year
print ten_years, ten_years.days

nine_years = ten_years - year
print nine_years

today= datetime.date.today()
print today
birthday =datetime.date(1977, 5, 4)
currenttime = datetime.datetime.now().time()
lunchtime = datetime.time(12, 00)
now = datetime.datetime.now()
next_year = today.replace(year = today.year + 1).strftime('%Y.%m.%d')
print next_year

NewYearsDay = datetime.date(2005, 01, 01)
NewYearsEve = datetime.date(2004, 12, 31)
oneday = NewYearsDay - NewYearsEve
print oneday
